<% content_for :head do %>
<script src="/javascripts/mootools-1.11.js" type="text/javascript" charset="utf-8"></script>
<script src="javascripts/mumimfine.js" type="text/javascript" charset="utf-8"></script>
<% end %>
<% if current_user.configured? %>
<h2>Enviar un mensaje a mi <%= current_user.mum %></h2>

<div>
<form id="sender" action="/send" method="POST">
  <p id="counter"></p>
  <textarea id="ta1" name="sms" rows="5" cols="85"></textarea>
  <input type="hidden" name="authenticity_token" value="<%= form_authenticity_token %>" />
  <a href="#" id="lnk_sender">Enviar este mensaje a mi <%= current_user.mum %></a>
</form>
</div>

<h2>Anteriormente...</h2>

<div id="msg_log">
  <%= render :partial => 'list_sms' %>
</div>

<script type='text/javascript'>
//<![CDATA[
window.addEvent('domready',function(){
	trimTA('ta1','counter',150);
	addEventsSender('sender','ta1','lnk_sender','msg_log','counter',150);
});
//]]>
</script>

<% else %>
  <h2>necesitas configurar tu cuenta</h2>  
  <%= render :partial => 'form_complete' %>
<% end %>